package com.meng.springcloud.service;

import com.meng.springcloud.mapper.DeptMapper;
import com.meng.springcloud.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * @author mwb
 * @version createtime: 2021/8/23 20:48
 */
@Service
public class DeptServiceImpl implements DeptService{
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public boolean addDept(Dept dept) {

        return true;
//        return deptMapper.addDept(dept);
    }
//
//    @Override
//    public boolean addDept(String dname) {
//        return deptMapper.addDept(dname);
//    }

    @Override
    public Dept queryDeptById(Long id) {

        Dept dept = new Dept();
        dept.setDname("111").setDeptno(1111L).setDb_source("11111");
        return dept;
//        return deptMapper.queryDeptById(id);
    }


    @Override
    public List<Dept> queryAll() {

        Dept dept1 = new Dept();
        dept1.setDname("111").setDeptno(1111L).setDb_source("11111");
        Dept dept2 = new Dept();
        dept2.setDname("222").setDeptno(2222L).setDb_source("22222");
        List<Dept> list = new ArrayList<>();
        list.add(dept1);
        list.add(dept2);
        return list;


//        return deptMapper.queryAll();
    }
}
